Euclidean Rhythms
https://gyazo.com/377ce9906b77d07fea84bb8a54880247
様々な民族音楽で用いられる特徴的なリズムが生成できるともっぱら言われるが、僕はあんまり知らないです 要約
n-stepのなかでpulseを均等にk回鳴らすといい感じのリズムになるよ
16stepだけじゃなくてもっとへんてこな数字(5とか11とか)でもおもしろいよ
オフセットかけるのもおすすめだよ
16stepでの見た目
code:plain
1: x... .... .... ....
2: x... .... x... ....
3: x... .x.. ..x. ....
4: x... x... x... x...
5: x..x ..x. .x.. x...
6: x..x .x.. x..x .x..
7: x..x .x.x ..x. x.x.
8: x.x. x.x. x.x. x.x.
9: x.xx .x.x .xx. x.x.
10: x.xx .x.x x.xx .x.x
11: x.xx .xx. xx.x x.xx
12: x.xx x.xx x.xx x.xx
13: x.xx xx.x xxx. xxxx
14: x.xx xxxx x.xx xxxx
15: xxxx xxxx xxxx xxx.
16: xxxx xxxx xxxx xxxx
TidalCyclesでは、Euclidean Rhythmsを簡単に生成できる記法「euclidean notation」がある https://youtu.be/aD-35W7rnFM?si=186JG14eYfocS0RU?t=650
code:hs
d1 $ sound "bd(5, 16)"
TidalCycles同様、euclidean notationが使える
code:js
s("bd(5, 16)")
floorを使う
code:javascript
function euclideanRhythms(pulses, steps, i) {
var t = i % (steps / pulses)
return floor(t) == 0
}
ちょっと元論文とリズム違うけどだいたい一緒だよ
時間を取得
code:javascript
function euclideanRhythmsInteg(pulses, steps, time) {
var t = floor(time) % (steps / pulses)
return floor(t) + fract(time)
}
これでシェーダでも使えるね
実装